Skip to content
lab components / Visuals

Empty State

Provide context and guidance to users when there is no content to display within a container.

This is a Lab component!

That means it doesn't satisfy our definition of done and may be changed or even deleted. For an exact status, please reach out to the Fancy team through the dev_fancy or ux_fancy channels.

import { EmptyState } from "@siteimprove/fancylab";

#Purpose

The EmptyState informs and guides users when no content is available within a container. It aims to:

  • Prevent user confusion
  • Communicate the reason for the absence of content
  • Provide actionable next steps or suggestions
  • Maintain a positive user experience

#Examples

An EmptyState typically includes the following elements:

  • Illustration: A visual cue that helps convey the state's meaning (success, reassurance, initiation, promotion, etc.).
  • Heading (Optional): A brief, clear title summarizing the state (e.g., "No issues," "No search results").
  • Description: Additional context or instructions to guide the user (e.g., "You have not resolved any issues yet." or "Create key metrics to track how your visitors complete key activities on your site.").
  • Call to Action(Optional): A button or link prompting the user to take a specific action (e.g., "View all issues," "Create key metric").

#Default

This component is used to show an empty state inside of other components. The component has the required props type and heading and the optional prop description. The different kinds of empty state types and the related illustrations are:

  • Success: Indicates a successful completion of a task. (IllustrationSuccess)
  • Reassure: Provides comfort and reassurance during a wait or lack of content. (IllustrationReassure)
  • Initiate: Prompts the user to begin an action or process. (IllustrationInitiate)
  • Promote: Encourages the user to explore specific features or content. (IllustrationPromote)

All the illustrations used by this component can be seen on the Illustrations Overview page.

No issues

You've resolved all issues on this site - well done!

<EmptyState type="success" heading="No issues" description="You've resolved all issues on this site - well done!" />

#With markdown

You can use Markdown formatting for the description prop by using the Markdown component.

No issues

This is a markdown string, it contains

  • A short list
  • with an emphasized word
  • and a link
const md = `This is a markdown string, it contains - A short list - with an *emphasized* word - and a [link](https://www.siteimprove.com)`; return <EmptyState type="success" heading="No issues" description={<Markdown>{md}</Markdown>} />;

You can add an optional link to the component or an optional button. Not both.

No resolved issues

You have not resolved any issues yet.

See all issues
<EmptyState type="reassure" heading="No resolved issues" description="You have not resolved any issues yet." link={{ href: "https://siteimprove.com", text: "See all issues" }} />

#With button

You can add an optional button to the component or an optional link. Not both.

No key metrics

Create key metrics to track how your visitors complete key activities on your site.

<EmptyState type="initiate" heading="No key metrics" description="Create key metrics to track how your visitors complete key activities on your site." button={{ text: "Create key metric", onClick: () => console.log("clicked") }} />

#Properties

Data insights that empower your team

Siteimprove Analytics gives you powerful insights into visitor behavior and website performance, so you can make data-driven decisions across teams.

PropertyDescriptionDefinedValue
typeRequired
"initiate" | "promote" | "reassure" | "success"The type of empty state
headingRequired
stringHeading for the empty state
descriptionOptional
| string | elementDescription for the empty state
object
buttonOptional
object
data-observe-keyOptional
stringUnique string, used by external script e.g. for event tracking
classNameOptional
stringCustom className that's applied to the outermost element (only intended for special cases)
styleOptional
objectStyle object to apply custom inline styles (only intended for special cases)
tabIndexOptional
numberTab index of the outermost HTML element of the component
onKeyDownOptional
functionCallback for onKeyDown event
onMouseDownOptional
functionCallback for onMouseDown event
onMouseEnterOptional
functionCallback for onMouseEnter event
onMouseLeaveOptional
functionCallback for onMouseLeave event
onFocusOptional
functionCallback for onFocus event
onBlurOptional
functionCallback for onBlur event

#Guidelines

#Best practices

#General

Use EmptyState when

  • a search query returns no matches.
  • a user has not yet created content.
  • a card, table, or similar container is empty.
  • data fails to load or display due to an error.

#Placement

Position the EmptyState within the content area where data would normally appear.

#Style

  • Siteimprove Design System: Adhere to Siteimprove's guidelines for color, typography, and spacing. If you are not using a component from Fancy, match the styling of your EmptyState to existing components for visual consistency.

#Do not use when

  • For situations where data is loading, use a Spinner or Table with loading state instead.
  • When a clear error message is available, display it prominently instead of a generic empty state. For example, you can use Message component instead.

#Accessibility

#For designers

  • Ensure sufficient color contrast between text and background, and use clear, descriptive headings.

#For developers

This component comes with built-in accessibility, no extra work required.

Explore detailed guidelines for this component: Accessibility Specifications

#Writing

  • Communicate the reason for the empty state directly and succinctly.
  • Avoid technical jargon and lengthy explanations.
  • Provide helpful suggestions or actions to move the user forward.
  • Ensure the language and visuals align with your brand's personality and style. Follow Tone of voice
  • Even in error states, maintain a positive and encouraging tone. Follow Active vs. passive voice and Errors and warnings.